package com.buba.service.impl;

import com.buba.dao.LoginLogMapper;
import com.buba.pojo.LoginLog;
import com.buba.service.LoginLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Service
public class LoginLogServiceImpl implements LoginLogService {
    @Autowired
    private LoginLogMapper loginLogMapper;
    @Override
    public void addLoginLog(LoginLog loginLog) {
        loginLogMapper.addLoginLog(loginLog);
    }

    @Override
    public long selLogging(Map<String, Object> map) {
        return loginLogMapper.selLogging(map);
    }

    @Override
    public List<LoginLog> selLoggingList(Map<String, Object> map) {
        return loginLogMapper.selLoggingList(map);
    }

    @Override
    public long delLoginLog(String ids) {
        List<Integer> list = new ArrayList<>();
        for(String id:ids.split(","))
            list.add(Integer.valueOf(id));
        return loginLogMapper.delLoginLog(list);
    }


}
